package operator;

import book.BookList;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: HP
 * Date: 2023 -03 -26
 * Time: 20:55
 */
public class FindOperator implements Operator{
    @Override
    public void process(BookList booklist) {
        Scanner sc=new Scanner(System.in);
        System.out.print("Please input the name of book what you want to find：");
        String name=sc.nextLine();
        for(int i=0;i< booklist.getSize();i++){
            if(booklist.getBooks(i).getName().equals(name)){
                System.out.println(booklist.getBooks(i));
                return;
            }
        }
        System.out.println("can't find the book...");
    }
}
